package com.rickpan.dto.response;

import java.util.List;

/**
 * 文件列表响应DTO
 */
public class FileListResponse {

    private List<FileInfoDTO> content;
    private Long totalElements;
    private Integer totalPages;
    private Integer currentPage;
    private StorageInfo storageInfo;
    
    // 构造函数
    public FileListResponse() {}
    
    public FileListResponse(List<FileInfoDTO> content, Long totalElements, Integer totalPages, Integer currentPage) {
        this.content = content;
        this.totalElements = totalElements;
        this.totalPages = totalPages;
        this.currentPage = currentPage;
    }
    
    // Getter和Setter方法
    public List<FileInfoDTO> getContent() {
        return content;
    }

    public void setContent(List<FileInfoDTO> content) {
        this.content = content;
    }
    
    public Long getTotalElements() {
        return totalElements;
    }
    
    public void setTotalElements(Long totalElements) {
        this.totalElements = totalElements;
    }
    
    public Integer getTotalPages() {
        return totalPages;
    }
    
    public void setTotalPages(Integer totalPages) {
        this.totalPages = totalPages;
    }
    
    public Integer getCurrentPage() {
        return currentPage;
    }
    
    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }
    
    public StorageInfo getStorageInfo() {
        return storageInfo;
    }
    
    public void setStorageInfo(StorageInfo storageInfo) {
        this.storageInfo = storageInfo;
    }
    
    /**
     * 存储信息内部类
     */
    public static class StorageInfo {
        private Long used;
        private Long quota;
        private Double percentage;
        
        public StorageInfo() {}
        
        public StorageInfo(Long used, Long quota, Double percentage) {
            this.used = used;
            this.quota = quota;
            this.percentage = percentage;
        }
        
        public Long getUsed() {
            return used;
        }
        
        public void setUsed(Long used) {
            this.used = used;
        }
        
        public Long getQuota() {
            return quota;
        }
        
        public void setQuota(Long quota) {
            this.quota = quota;
        }
        
        public Double getPercentage() {
            return percentage;
        }
        
        public void setPercentage(Double percentage) {
            this.percentage = percentage;
        }
        
        @Override
        public String toString() {
            return "StorageInfo{" +
                    "used=" + used +
                    ", quota=" + quota +
                    ", percentage=" + percentage +
                    '}';
        }
    }
    
    @Override
    public String toString() {
        return "FileListResponse{" +
                "content=" + (content != null ? content.size() + " items" : "null") +
                ", totalElements=" + totalElements +
                ", totalPages=" + totalPages +
                ", currentPage=" + currentPage +
                ", storageInfo=" + storageInfo +
                '}';
    }
}
